package com.nine.liteflow.component;

import com.yomahub.liteflow.core.NodeComponent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component("a")
public class ACmp extends NodeComponent {
    @Override
    public void process() throws Exception {
        boolean access = isAccess();
        if (access) {
            log.info(">>>>>>>>>>组件a.process...");
        }
        else {
            log.info(">>>>>>>>>>组件a，无需处理");
        }
    }


    /**
     * 推荐实现isAccess方法，表示是否进入该节点，可以用于业务参数的预先判断
     */
    @Override
    public boolean isAccess() {
        return super.isAccess();
    }
}
